//
//  ShellProfitViewController.m
//  ShellWallert
//
//  Created by lvzhao on 2019/10/23.
//  Copyright © 2019 VV. All rights reserved.
//

#import "ShellProfitViewController.h"
#import "ShellProfitView.h"
#import "ShellProfitViewModel.h"

@interface ShellProfitViewController ()
@property (nonatomic,strong) ShellProfitView *profitView;

@property (nonatomic,strong) ShellProfitViewModel *viewModel;
@end

@implementation ShellProfitViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = LZLocalizedString(@"我的收益");
    // Do any additional setup after loading the view.
    
    [self setupUI];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.barTintColor = COLOR_TINT;
}



#pragma mark - setupUI
- (void)setupUI{
    [self.view addSubview:self.profitView];
    [self.profitView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    //今日收益
    [self.viewModel getTodayProfit];
    [self.viewModel getHistoryProfit:YES];
}

#pragma mark - actions

#pragma mark - custool

#pragma mark - get && set
- (ShellProfitView *)profitView{
    
    if(!_profitView){
        _profitView = [[ShellProfitView alloc] initViewModel:self.viewModel];
    }
    return _profitView;
}

- (ShellProfitViewModel *)viewModel{
    if(!_viewModel){
        _viewModel = [[ShellProfitViewModel alloc] init];
        _viewModel.wallertModel = self.wallertModel;
    }
    return _viewModel;
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
